package com.woniu.shop.rabibit;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class ApplicationProduct {
    @Autowired
    private RabbitTemplate rabbitTemplate;
    /**
     *  参数1：交换机名称
     *  参数2：队列名称
     *  参数3：发送的消息
     */
    public void sendMessage(Integer id){
        rabbitTemplate.convertAndSend("exchange-application","queue-application",id);
    }
}
